home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
By Popular Request 2.0
/
By Popular Request 2.0 (Arsenal Computer).ISO
/
amiga_5
/
pltrej02.lha
/
PlutReject.doc
< prev
next >
Wrap
Text File
|
1994-10-16
|
10KB
|
262 lines
------------------------------------------------
PlutReject
Utility to bypass receiving a file you already have
by Peter Deane (3:622/401)
Version 0.2 16 October 1994
in GFA BASIC V3.51
------------------------------------------------
Introduction
============
In the TRAPDOOR support echo, Mike Hall asked this question:
MH> I've got a few file echo's set up and manually poll for a some of
MH> them, sometimes I've already got the files and so am wondering is
MH> there a way to skip the current transfer and not abort the whole
MH> trapdoor session? It's painful when calling STD watching a 500k
MH> file come in when you've allready got it! :8-/
Good point, I thought, and supplied Mike with this answer:
PD> Hey, it's even worse polling INTERNATIONALLY and having this happen
PD> as well!
PD> But there IS something you can do about it. Sit down while I tell you a
PD> tale of partial files and resuming transfers....
PD> When TrapDoor receives a partial file it renames it. The filenaming
PD> scheme used is:
PD> !.Filename.A.B.C.D
PD> Where "Filename" is the original filename of the file and A.B.C.D
PD> is the address of the system sending you that file.
PD> For example if you were receiving a file called Foo.lha, from
PD> 3:622/401 (me) and it was aborted halfway through for some reason
PD> the filename of the partial file would be:
PD> !.Foo.lha.3.622.401.0
PD> This partial file would ALSO contain a filenote. This consists of
PD> three parts terminated by a semicolon:
PD> Length 123456; FileName Foo.lha; Time d17089c8;
PD> Okay, so using this information we can fool TrapDoor into resuming
PD> a file transfer at ANY stage. What we want to do is for it to
PD> resume at an offset equal to the length of the file.
PD> Let's assume we have received a file called TD_1_84.lha from a
PD> system, and now ANOTHER system is also trying to send us that file,
PD> which we don't want. Let's also assume the filesize is 300,000
PD> bytes long, and the address of the system now trying to send it to
PD> us is 1:234/567.8.
PD> When the other end starts to send us the file, we hangup. Okay
PD> what you need to do now is copy the _original_ file into your
PD> inbound directory. Use a copy so you can delete it later. The
PD> file has to be exactly the right length, BTW
PD> Firstly we rename this temporary file using the above convention:
PD> Rename TD_1_84.lha as !.TD_1_84.lha.1.234.567.8
PD> Then we need to set the filenote. We only need the Length and
PD> Filename fields, the time isn't necessary.
PD> FileNote !.TD_1_84.lha.1.234.567.8 "Length 300000; FileName TD_1_84.lha; "
PD> And with that in the inbound directory we call back.
PD> The result will be "Resuming Transfer from Offset 300000", and
PD> since 300000 is the actual size of the file, 0 bytes of it will be
PD> transferred and then the system will send you the next file it has
PD> for you.
PD> Since the system thinks it has succesfully sent you the file, it
PD> shouldn't try sending it again (if it was a TrapDoor, a tilde would
PD> be prepended to the filename in the FLO file).
PD> Regards,
PD> -Peter!
PD> PS: TrapDoor will rename our temporary file in inbound to the
PD> correct name doing this, BTW! :-)
The answer was well received except for one small point: it's a bit
complicated, isn't it? Well, I couldn't argue with that. Andy McArdle
suggested that this would be a candidate for a Plutonic utility.
And so was born PlutReject, a small utility to take a lot of the hard
work out of the above steps, but still resulting in a renamed file in
the inbound directory with the relevant FileNote to enable TrapDoor to
resume transfer at the offset equal to the length of the file - in
effect "cancelling" the incoming file.
Using PlutReject
================
To save PlutReject a bit of work, the first thing you need to do is to
put a copy of the file you don't want into the inbound directory.
Since the file is going to be safe, if you're running short of
drivespace you can use your only copy if you like, and then move it back
to where it belongs later. Alternatively, use a copy in the inbound,
and then you can delete it from there when the transfer is finished.
Once the file is in the inbound, you need to run PlutReject and tell
PlutReject two things:
Firstly the full path and filename of the file. (EG
MAIL:Inbound/NodeDiff.L87). If you CD to the inbound directory before
running PlutReject, then just the filename itself will suffice (ie
NodeDiff.L87). You can use an assignment as well (eg IN:NodeDiff.L87)
PlutReject will complain if it can't find this file, and exit.
Secondly you need to tell PlutReject the node number of the system
sending you the file. If this is in zone 3, you may omit the zone. If
this is a point zero (ie a BBS, not a point), you can omit the point
number. So, to PlutReject these numbers mean the same thing:
3:622/401.0, 3:622/401, 622/401 and 622/401.0
This number has to be the PRIMARY address of the system sending you the
file - !NOT! one of the system's AKAs. You could be in for a shock if
the system is on a rotary group for instance and presents a different
primary node number on your next call. Unfortunately there's not much
we can do about that...
The node number must be in a valid fido node number format. If not,
PlutReject will complain and again, exit.
[Don't forget you MUST specify the zone if it's not in Zone 3]
The file you are receiving must match exactly with the length of the
file you already have. If it's out by as much as 1 byte, TrapDoor will
think this is a different file, and PlutReject won't work as you expect
it. You could always adjust the length of the dummy file you have to
match what the system is sending you if this causes a problem. In this
case, I'd recommend the dummy file in your inbound is a COPY of the
original file :-)
Also, this will only work if the other end supports transfer resuming
(virtually ALL systems do these days under a Zmodem derivative, eg
ZedZap, TrapZap, etc)
Examples
========
1.> PlutReject Mail:Inbound/NodeDiff.L87 3:711/501
1.> PlutReject IN:NodeDiff.L87 711/501
1.> CD Mail:Inbound
1.> PlutReject NodeDiff.L87 3:711/501.0
Test Run
========
To test this out, I sent away a freq for a NodeDiff I already have.
Firstly I used a directory utility to whip a copy over into the inbound.
I then ran PlutReject using one of the above examples, and called
3:711/501. The TrapDoor log went like so (I sent and picked up a bit of
mail during this test call, but I've cut out those lines):
+ 16-Oct-94 15:12:42 Calling Sentry's Shadow (3:711/501.0)
~ 16-Oct-94 15:13:05 CONNECT 12000/REL
: 16-Oct-94 15:13:18 Name: Sentry's Shadow (3:711/501.0)
: 16-Oct-94 15:13:18 Sysop: Trev Roydhouse
: 16-Oct-94 15:13:18 Using: BinkleyTerm 2.59
: 16-Oct-94 15:13:18 Offer: WaZoo FReqs ZedZap ArcMail
: 16-Oct-94 15:13:19 TrxID: 2ea14302
* 16-Oct-94 15:13:19 Password-protected session
= 16-Oct-94 15:13:19 Protocol: WaZoo/ZedZap
| 16-Oct-94 15:13:31 Sending 02c701f5.req (14 bytes)
| 16-Oct-94 15:13:32 Took 0:00, Cps: 23, Efficiency: 1%
| 16-Oct-94 15:13:32 Sent 02c701f5.req (14 bytes) successful
| 16-Oct-94 15:15:30 Receiving nodediff.l87 (65245 bytes)
| 16-Oct-94 15:15:30 Resuming transfer from offset 65245
| 16-Oct-94 15:15:31 Took 0:00, Cps: 0, Efficiency: 0%
| 16-Oct-94 15:15:31 Received nodediff.l87 (65245 bytes) successful
= 16-Oct-94 15:15:42 Session connect time 2:36, cost 0.31
~ 16-Oct-94 15:15:42 Hanging up modem
So as you can see, rather than taking some time to receive the file,
this takes only 1 second, saving a substantial amount of transfer time
receiving a file you already have!
Limitations
===========
This will NOT work if the file you are receiving has spaces in it. DO
NOT USE INVERTED COMMAS in the arguments - we don't parse them at all.
Remember
========
The dummy file in your inbound directory will be renamed back to the
proper filename after TrapDoor calls back. Don't forget to clean the
directory up by copying the file back to where it belongs or deleting
it.
Distribution and Politics
=========================
The PlutReject archive currently consists of these files:
PlutReject Executable
PlutReject.doc This file
PlutReject.lst GFABASIC Source (ascii)
It may NEVER be distributed without all the above files being present in
the distribution copy. No charge over and above a small copying fee may
ever be levied on the distribution of the program.
All copyrights are retained by the author. If you use any part of the
source in other programs, acknowledgement must be given.
The liability of the author for any damages caused by this program is
limited to the amount the user has paid directly to the author for the
right to use the software (ie nil). Claims for amounts greater than this
will be refused.
The author can be contacted:
Peter Deane
FidoNet: 3:622/401 Postal: PO Box 228
GlobalNet: 54:6101/401 Swansea NSW 2281
AmigaNet: 41:200/401 AUSTRALIA
BBS: from O/S +61-49-72-1647
(24hrs) from Aust (049) 72-1647
------------------------------------------------